package cn.ricecode.restructure.util;

import cn.ricecode.restructure.enums.RoleEnum;

/**
 * @author LiuZhulan
 */
public class JudgeRoleUtil {

    public static String jungeByIf(String roleName){
        String res="";
        if(roleName.equals("ROLE_ADMIN")){
            return "admin";
        }else if (roleName.equals("ROLE_USER")){
            return "user";
        }
        return res;
    }

    public static String jungeByEnum(String roleName){
        return RoleEnum.valueOf(roleName).op();
    }
}
